// created by noellynch
// May 12, 2009

package com.sceneworker.monitorpopup;

import java.awt.event.ActionEvent;

import javax.swing.JDialog;
import javax.swing.tree.TreePath;

import com.jme.scene.Skybox;
import com.sceneworker.app.globals.SceneWorkerDialogManager;
import com.sceneworker.editors.skybox.SkyBoxEditorPanel;

public class SkyBoxMenu extends BaseMenu {

	private static final String EDIT_SKY_BOX = "Edit SkyBox";
	private		Skybox		mcl_skyBox;
	
	public SkyBoxMenu(TreePath cl_selectedPath, SceneWorkerPopUp cl_menu) {
		super(cl_menu);
		
		mcl_skyBox = (Skybox)cl_selectedPath.getLastPathComponent();
		
		buildMenu();
	}

	@Override
	public void actionPerformed(ActionEvent cl_e) {
		if(cl_e.getActionCommand().equals(EDIT_SKY_BOX)) {
			JDialog		lcl_dlg = SceneWorkerDialogManager.inst().makeADialog(SceneWorkerDialogManager.SKYBOX_EDITOR_DIALOG);
			lcl_dlg.add(new SkyBoxEditorPanel(mcl_skyBox, lcl_dlg));
			lcl_dlg.setVisible(true);
		}
	}

	@Override
	protected void buildMenu() {
		mcl_menu.addSeparator();
		mcl_menu.add(buildAMenuItem(EDIT_SKY_BOX));
		mcl_menu.addSeparator();
	}

}
